package com.lecyon.farm;

import com.lecyon.farm.common.constant.CommonConstant;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * 主启动类
 *
 * @author YaoZheng
 */
@SpringBootApplication
@EnableSwagger2
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = CommonConstant.MAX_INACTIVE_INTERVAL_IN_SECONDS)
@EnableCaching
@ServletComponentScan
@EnableScheduling
@EnableFeignClients
@EnableElasticsearchRepositories(basePackages = "com.lecyon.farm.mapper")
public class FarmApplication {
    public static void main(String[] args) {
        System.setProperty("es.set.netty.runtime.available.processors", "false");
        SpringApplication.run(FarmApplication.class, args);
    }
}
